﻿@using VirtualPress.Infrastructure.Entities.Entity;
@using VirtualPress.Infrastructure.Entities.Enum;
@{
    ViewBag.Title = "Article";
    Layout = "/Areas/WorkSpace/Views/Shared/_WorkSpace.cshtml";
}
@{
    ItemListBox<Article> articles = ViewBag.Data;
}
<div id="content-header">
    <h1>
        最新稿件管理</h1>
</div>
<div id="breadcrumb">
    <a href="/WorkSpace/press/index" class="tip-bottom"><i class="icon-home"></i>起始页</a> <a href="javascript:"
        class="current">最新稿件</a>
</div>
<div class="container-fluid">
    <div class="row-fluid">
        <div class="span12">
            <span style="font-size: 10px; color: Red;">注：如果您误删稿件，请联系管理员处理。</span>
            <div class="widget-box" style="margin-top: 0px;">
                <div class="widget-title">
                    <h5>
                        最新稿件</h5>
                </div>
                <div class="widget-content nopadding">
                    <table class="table table-bordered">
                        <thead>
                            <tr style="cursor: pointer;">
                                <th>
                                    标题
                                </th>
                                <th style="width: 16%">
                                    作者
                                </th>
                                <th style="width: 10%">
                                    稿件状态
                                </th>
                                <th style="width: 20%">
                                    稿件范围
                                </th>
                                <th style="width: 12%">
                                    期刊
                                </th>
                                <th style="width: 10%">
                                    来稿时间
                                </th>
                                <th style="width: 15%">
                                    操作
                                </th>
                            </tr>
                        </thead>
                        <tbody>
                            @{
                                if (articles != null && articles.Data != null &&
                                    articles.Data.Any())
                                {
                                    foreach (var item in articles.Data)
                                    {
                                <tr>
                                    <td>
                                        <a target="_blank" href="/workspace/console/articledetail/@item.Id">@item.Title</a>
                                    </td>
                                    <td style="text-align: center">
                                        @{string authors = string.Empty;
                                          item.ArticleAuthor.ForEach(
                                          c => { authors += c.AuthorName + "， "; });
                                          authors = authors.Trim();
                                          authors = authors.Remove(authors.Length - 1); }
                                        @authors
                                    </td>
                                    <td style="text-align: center">
                                        @if (item.Status == ArticleStatus.ZhuanShenWanCheng ||
                                            item.Status == ArticleStatus.ZhuanShenXiuDingWanCheng)
                                        {
                                            <span style="color: #51a351"><b>@item.Status.Mapping()</b></span>
                                        }
                                        else
                                        {
                                            @item.Status.Mapping()
                                        }
                                    </td>
                                    <td style="text-align:center">
                                        <span title="@item.GJFW.Replace(";","、 ")">@item.GJFW.Replace(";", "、 ")</span>
                                    </td>
                                    <td style="text-align: center">
                                        @item.Journal.Name
                                    </td>
                                    <td style="text-align: center">
                                        @item.CreateTime.ToString("yyyy-MM-dd")
                                    </td>
                                    <td style="text-align: center">
                                        @if (item.IsDelete)
                                        {
                                            <i>稿件已删除</i>
                                        }
                                        else
                                        {
                                            <a target="_blank" href="/workspace/press/articledetail/@item.Id" class="btn btn-success btn-mini">
                                                查看</a>
                                        }
                                    </td>
                                </tr>
                                    }
                                }
                            }
                        </tbody>
                    </table>
                </div>
                @Html.Raw(articles.PageItemSegment)
            </div>
        </div>
    </div>
</div>
@section tail{
<script type="text/javascript">
    $(function () {
        $('#likarticle').addClass('open active');
    });
</script>
}